import { createSlice } from '@reduxjs/toolkit'
import  menu from './menu'

const commonState = {
    menu,
    curMenu: '首页'
}

export const commonSlice = createSlice({
  name: 'common',  
  initialState:commonState,
  reducers: {
    setMenu(state,action){
        state.menu =  action.payload;
    },
    setCurMenu(state,action){
       state.curMenu = action.payload
    }
  },
})


export const { setMenu  ,setCurMenu} = commonSlice.actions

export default commonSlice.reducer